package com.yuju.login.enums;
/**
 * 
 * 类名：OpReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : zhousc <br />
 * @Date : 2017年12月4日 上午10:39:54  <br />
 * @version : 1.1 <br />
 */
public enum OpReturnCodeEnum {
	OP_QUERY_SUCCESS("yuju-op-1000", "账户查询成功"),
	OP_QUERY_FAILURE("yuju-op-1001", "账户查询失败"),
	OP_SAVE_SUCCESS("yuju-op-1002", "账户保存成功"),
	OP_SAVE_FAILURE("yuju-op-1003", "账户保存失败"),
	OP_UPDATE_SUCCESS("yuju-op-1004", "账户更新成功"),
	OP_UPDATE_FAILURE("yuju-op-1005", "账户更新失败"),
	OP_DEL_SUCCESS("yuju-op-1006", "账户删除成功"),
	OP_DEL_FAILURE("yuju-op-1007", "账户删除失败"),
	OP_NOOP_FAILURE("yuju-op-1008", "账号不存在"),
	OP_LOGIN_SUCCESS("yuju-op-1009", "登录成功"),
	OP_LOGIN_FAILURE("yuju-op-1010", "密码输入错误"),
	OP_PROHIBITED_FAILURE("yuju-op-1011", "账号已禁止使用"),
	OP_NEWPASSWORD_NODATA("yuju-op-1012", "新密码不能为空"),
	OP_NEWPASSWORD_FAILURE("yuju-op-1013", "原始密码错误"),
	OP_VALID_SUCCESS("yuju-op-1014", "校验成功"),
	OP_VALID_FAILURE("yuju-op-1015", "校验失败");
	
	
	
	
	private String code;
	private String desc;
	
	OpReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (OpReturnCodeEnum enume : OpReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}